/**
 * Applikationsutveckling i Java, 5DV135
 * HT12
 * Project
 * 
 * File: TeleportTest.java
 * Description: A JUnitTestCaseClass used for testing the class
 * 				Teleport.
 * Date: 18 december 2012
 * 
 * cs-user: dv11mgr
 * @author Maria Gramner
 */

package nullInvader.Test;
import java.awt.Image;
import java.awt.Point;
import nullInvader.Engine.Teleport;
import junit.framework.TestCase;


public class TeleportTest extends TestCase {

	Point position; 
	Teleport teleport;

	/**
	 * setUp method that creates the necessary objects
	 * for testing correctly
	 */
	public void setUp(){
		position = new Point(4,5);
		teleport = new Teleport(true, position);
	}


	/**
	 * Test for the constructor
	 */
	public void testConstructor(){
		Point position1 = new Point();
		Teleport teleport1 = new Teleport(true, position1);
		/*Checks that a teleport was made*/
		assertNotNull(teleport1);
	}


	/**
	 * Test that both the method setIcon and getIcon
	 * works correctly.
	 */
	public void testSetGetIcon(){
		Image icon = teleport.getIcon();
		assertNotNull(icon);
	}


	/**
	 * tearDown method
	 */
	public void tearDown(){
		position = null;
		teleport = null;
	}
}
